import { defineConfig } from 'vite'
// import react from '@vitejs/plugin-react-swc'
import qiankun from "vite-plugin-qiankun";
const { name } = require("./package.json")
const { reactApp } = require("../config.js")
console.log(reactApp);

// https://vitejs.dev/config/
export default defineConfig(({ mode }) => {
  console.log(mode);

  return {

    base: mode === "development" ? "/" : reactApp,
    plugins: [
      // react(),
      qiankun(name, {
        useDevMode: true,
      })
    ],
    server: {
      port: 3001
    },
    build: {
      outDir: "../../dist/reactApp",
      emptyOutDir: true,
    },
  }
})
